<!DOCTYPE html>
<html>
<head>
    {{include "header.html" .}}

    <style>
        /*全局样式*/
        .layui-nav-tree .layui-nav-item>a .layui-nav-more {
            padding: 0px 0 !important;
        }

        .layui-nav .layui-nav-more {
            content: '';
            width: 0;
            height: 0;
            border-style: solid dashed dashed;
            border-color: #fff transparent transparent;
            overflow: hidden;
            cursor: pointer;
            transition: all .2s;
            -webkit-transition: all .2s;
            position: absolute;
            top: 50%;
            right: 3px;
            margin-top: -3px;
            border-width: 6px;
            border-top-color: rgba(255, 255, 255, .7);
        }

        .layui-layout-admin .layui-body {
            bottom: 44px !important;
        }
    </style>
</head>
<body>
<div class="layui-layout layui-layout-admin">

    {{include "common/header.html" .}}

    {{include "common/left.html" .}}

    <!-- 主体部分 -->
    <div class="layui-body"></div>

    {{include "common/footer.html" .}}

</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>
<script>
    layui.use(['index', 'admin', 'laytpl', 'element'], function () {
        var $ = layui.jquery;
        var index = layui.index;
        var element = layui.element;
        var admin = layui.admin;
        var laytpl = layui.laytpl;

        var userId = "{{.Context.User.Id}}";


        // 默认加载主页
        index.loadHome({
            menuPath: 'index/home',
            menuName: '<i class="layui-icon layui-icon-home"></i>'
        });

        // 修改密码点击事件
        $('#setPsw').click(function () {
            admin.open({
                id: 'pswForm',
                type: 2,
                title: '修改密码',
                shade: 0,
                content: 'user/update-password'
            });
        });

        $('#viewInfo').click(function () {
            // admin.open({
            //     type: 2,
            //     title: '个人信息',
            //     shade: 0,
            //     maxmin: true,
            //     resize: true,
            //     area: ['781px', '388px'],
            //     content: '/admin/user/view/' + userId
            // })
            index.openTab({
                title: '个人中心',
                url: 'user/info',
                end: function() {}
            });
        });

        // 退出登录点击事件
        $('#btnLogout').click(function () {
            layer.confirm('确定退出登录？', {
                skin: 'layui-layer-admin'
            }, function () {
                index.clearTabCache();
                window.location.href = 'user/logout';
            });
        });
    });
</script>
</body>
</html>